package com.chen.exception;

import com.chen.common.R;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@Slf4j
@RestControllerAdvice
public class ProjectExceptionHandler {

    //捕获程序未预计到的异常处理
    @ExceptionHandler
    public R<String> doException(Exception e){
        log.info(e.getMessage());
        return R.error(e.getMessage());
    }
}
